package com.hmy.finance.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @author songkf
 */

@Getter
public enum ProfitLossStatusEnum {
    //状态（0-待生效，1-已生效，9-已失效）
    WAIT_EFFECTIVE("0", "待生效"),
    ALREADY_EFFECTIVE("1", "已生效"),
    ALREADY_INVALID("9", "已失效"),
    RECONCILED("21", "月结&期结已对账");
    @EnumValue
    private final String value;
    private final String desc;

    ProfitLossStatusEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDescByValue(String value) {
        for (ProfitLossStatusEnum e : values()) {
            if (e.getValue().equals(value)) {
                return e.getDesc();
            }
        }
        return null;
    }
}
